/*
 * @Author: caozaihui
 * @Date: 2024-06-21 09:36:08
 * @LastEditors: czh 2119294696@qq.com
 * @LastEditTime: 2024-06-29 22:18:45
 * @FilePath: \YMU_forum_vue\src\apis\user.js
 */


import httpInstance from "@/utils/http";

//获取文章的标签
export function getArticleTagList(){
    return httpInstance({
        url:`/tag/articleTagList`,
        method:'get'
    })
}
//
//获取用户标签信息
export function getUserTagList(){
    return httpInstance({
        url:`/tag/tagList`,
        method:'get',
    })
}

export function getUserArticleList(){
    return httpInstance({
        url:`/article`,
        method:'get',
    })
}

export function getUserInfo(){
    return httpInstance({
        url:`/user`,
        method:'get',
    })
}

export function updateUserInfo(data){
    return httpInstance({
        url:`/user`,
        method:'put',
        data:data
    })
}
// 更新标签值
export function updateTagName(tag){
    return httpInstance({
        url:`/tag`,
        method:'put',
        data:tag
    })
}

// 删除一个标签
export function deleteTag(tagId) {
    return httpInstance({
        url:`/tag/${tagId}`,
        method:'delete',
    })
}

// 新增标签
export function postNewTag(tag){
    return httpInstance({
        url:`/tag`,
        method:'post',
        data:tag
    })
}
//修改密码
export function updatePassword(psd){
    return httpInstance({
        url:`/user/updatePsd`,
        method:'post',
        data:psd
    })
}